<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='./vue.js'></script>
</head>

<body>
    <div id='app'>
        <h1>爷爷组件 - {{title}} </h1>
        <father :title="title" :style="{border: '1px solid red'}"></father>

    </div>
</body>
<script>


    const son = {
        template: `<h1>
            子组件 - {{title}}
        </h1>`,
        props: ['title']
    }


    const father = {
        template: `<h1>
            父组件 - {{title}}
            <son :title='title' :style="{border: '1px solid red'}" />  
        </h1>`,
        props: ['title'],
        components: {
            son
        }
    }


    const app = {
        data() {
            return {
                title: '传家宝'
            }
        },
        methods: {},
        components: {
            father
        }
    }
    const vm = Vue.createApp(app).mount('#app')
</script>

</html>